//
//  UIWebView+JSCategory.h
//  jSCoreTest
//
//  Created by rain on 2018/6/26.
//  Copyright © 2018年 company. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <JavaScriptCore/JavaScriptCore.h>

@protocol RainWebViewDelegate <UIWebViewDelegate>

@optional
/*! @brief 获取当前的JSContext */
- (void)webView:(UIWebView *)webView didCreateJavaScriptContext:(JSContext *)context;

/*! @brief 获取当前网页的document.title */
- (void)webView:(UIWebView *)webView didReceiveTitle:(NSString *)title;

/*! @brief 只带“确定”按钮的告警弹框 */
- (void)webView:(UIWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message;

/*! @brief 带“确定”和“取消”按钮的告警弹框 */
- (void)webView:(UIWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message;

@end



@interface UIWebView (JSCategory)

@property (nonatomic,readonly)JSContext *context;//把当前webview上获取的jscontext设置为web的属性context,方便获取使用

@end
